# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=tactical-exploitation
pkgver=99.cb287f0
pkgrel=2
pkgdesc='Modern tactical exploitation toolkit.'
groups=('blackarch' 'blackarch-scanner' 'blackarch-exploitation'
        'blackarch-recon' 'blackarch-sniffer')
arch=('any')
url='https://github.com/0xdea/tactical-exploitation'
license=('MIT')
depends=('python' 'python-argparse' 'python-netaddr' 'python-requests'
         'python-urllib3' 'python-shodan' 'python-google-api-python-client')
makedepends=('git')
source=("git+https://github.com/0xdea/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  _tools='botshot easywin letmein netdork poriluk seitan verbal'

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm README.md LICENSE

  cp -a * "$pkgdir/usr/share/$pkgname/"

  for t in $_tools
  do
    cat > "$pkgdir/usr/bin/$t" << EOF
#!/bin/sh
exec python /usr/share/$pkgname/$t.py "\$@"
EOF
    chmod +x "$pkgdir/usr/bin/$t"
  done
}

